const TOKEN_NAME = 'hm-news-83'
const channelName = 'hm-channel-83'
const historyList = 'hm-history-83'

export function setToken (token) {
  localStorage.setItem(TOKEN_NAME, JSON.stringify(token))
}
export function getToken () {
  return JSON.parse(localStorage.getItem(TOKEN_NAME)) || {}
}
export function removeToken () {
  localStorage.removeItem(TOKEN_NAME)
}
export function setChannel (channel) {
  localStorage.setItem(channelName, JSON.stringify(channel))
}
export function getChannel () {
  return JSON.parse(localStorage.getItem(channelName))
}
export function getHistory () {
  return JSON.parse(localStorage.getItem(historyList)) || []
}
export function setHistory (List) {
  localStorage.setItem(historyList, JSON.stringify(List))
}
